package com.yanyilu.basing.mapper;

import com.yanyilu.basing.entity.Leaderboard;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Sxx
 * @since 2020-10-26
 */
public interface LeaderboardMapper extends BaseMapper<Leaderboard> {

    List<Leaderboard> selectAllOrderByRank();

    int countByTomil(@Param("totalMileage") Integer totalMileage);

    void updateRankByMil(@Param("totalMileage") Integer totalMileage);

    Leaderboard selectByUserId(@Param("userId") Integer userId);

    List<Leaderboard> selectBycontactDetails(@Param("contactDetails") String contactDetails);

    void adminDeleteByUserId(@Param("userId")Integer userId);
}
